Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference the true interface file (.resi, rei) when an implementation fails to implement its contract #46

Open
wants to merge 56 commits into
base: 4.06.1+BS
Choose a base branch
from

Conversation

mweichert
Copy link

ReScript developers don't understand (or shouldn't need to understand) why a .cmi file is referenced, especially when it doesn't exist in the path referenced in the error message.

Before:

The implementation /Users/mweichert/Projects/github/personal/example/src/Foo.res
       does not match the interface src/Foo.cmi:

After:

The implementation /Users/mweichert/Projects/github/personal/example/src/Foo.res
       does not match the interface /Users/mweichert/Projects/github/personal/example/src/Foo.resi:

Note that `Some ()` goes to constant branch
For constant branch, we pretty much know it is. undefined or not
while `Some (x : unit)` goes to type based analysis
For type based, if it is predefined unit, done, otherwise need check its constructor description
turn Fld_na to Fld_na of string for debugging
- transl_extension_path will be a temporary thing, it is a string in BS
- in native, for non-const, it compares (Fld 0) with `transl_extension_path`, for const, it use itself to compare against `transl_extension_path`
- for bs, in both cases, it calls `extension_slot_eq exn transl_extension_path`
@bobzhang
Copy link
Member

@mweichert thanks for the suggestions, we will think about it. Note it is a bit more complicated since the source are in various syntaxes

@bobzhang bobzhang force-pushed the 4.06.1+BS branch 3 times, most recently from 487c226 to 0090035 Compare April 2, 2021 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants